﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace GameSchool.Models
{
	/// <summary>
	/// Assignment er gagnaklasi sem geymir þær upplýsingar sem þarf til að skrá ný verkefni í gagnagrunninn. 
	/// </summary>   
	
	[Table("gs_assignment")]
	public class Assignment
    {
        public Assignment()
        { 
            this.Questions = new List<AssignmentQuestion>();
            this.VideoLectures = new List<VideoLecture>();
        }

		[Key]
		[Column("assignment_id")]
        public int AssignmentId { get; set; }

        [Column("level_id")]
        public int LevelId { get; set; }

		[Column("description")]
		[Display(Name = "Lýsing verkefnis")]
		[Required(ErrorMessage = "Vinsamlegast settu inn lýsingu á verkefninu")]
		public string Description { get; set; }

        [ForeignKey("LevelId")]
        public virtual Level Level { get; set; }

		[Column("title")]
		[Display(Name = "Titill")]
		[Required(ErrorMessage = "Vinsamlegast settu inn titil")]
        public string Title { get; set; }

		[Column("is_mandatory")]
        public bool IsMandatory { get; set; }

		[Column("points")]
		[Display(Name = "Heilasellur")]
        public int Points { get; set; }

		[Column("active")]
        public bool Active { get; set; }

        [Column("entry_by")]
        public int EntryBy { get; set; }

        [Column("entry_date")]
        public DateTime EntryDate { get; set; }

        public virtual ICollection<AssignmentQuestion> Questions { get; set; }
        public virtual ICollection<VideoLecture> VideoLectures { get; set; }
    }
}